<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // 变量如果重复声明了，不会报错(其他语言是报错的) 之后覆盖

        // 变量存的值是可以被改变的


        var a = 2;

        document.write(a);   // 2

        var a = 4;   // 

        document.write(a);   // 4

        // a重新赋值为hi
        a = 'hi';

        document.write(a);   // hi


    </script>

</body>

</html>